<?php
/*
* Author: Nurte
* @package www.nurte.com Nurte Facebook Like Box
* @copyright Copyright (C) 2010-2013 Nurte sp. z o.o. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* Version 2.0.0.0
*/

defined( '_JEXEC' ) or die( 'Restricted access' );

class ModNurteFbLikebox
{
	function getNurteFbLikebox( $params )   {
		$language	= &JFactory::getLanguage();
		$langtag	= 'en_GB';
		if ($language) $langtag = str_replace("-","_",$language->get('tag'));

		$uri		= &JFactory::getURI();
		$scheme		= $uri->getScheme();
		
		$css_url	= trim($params->get('css'));
		$css_url 	= $css_url == '' ? '' : ' css="'.$css_url.'"';

		$fb_likebox    = '<script src="'.$scheme.'://connect.facebook.net/'.$langtag.'/all.js#xfbml=1"></script>'
				.'<div class="fb-like-box"'
				.' data-href="'.trim( $params->get('pageurl') ).'"'
				.' data-width="'.trim( $params->get('width') ).'"'
				.($params->get('height')!=""?' data-height="'.trim( $params->get('height') ).'"':'')
				.($params->get('faces')!=""?' connections ="'.trim( $params->get('faces') ).'"':' data-show-faces="false"')	 
				.' data-colorscheme="'.trim( $params->get('colorscheme') ).'"' 
				.' data-stream="'.trim( $params->get('stream') ).'"' 
				.' data-show-border="'.trim( $params->get('border') ).'"'
				.' data-header="'.trim( $params->get('header') ).'"'
				.'></div>'
				.' <noscript>JavaScript must be enabled in order for you to use the Nurte Facebook Like Box. However, it seems JavaScript is either disabled or not supported by your browser. To use the Nurte Facebook Like Box, enable JavaScript by changing your browser options, then <a href="'.$uri->toString().'">try again.</a></noscript>';

		return $fb_likebox;
	}
}

?>